package data.missions;

import data.tileables.Unit;
import data.tileables.Rally;

public class PowerDownUnit extends PowerDown{
	private Unit thisUnit;
	public PowerDownUnit(Unit u)
	{
		super();
		thisUnit = u;
	}
	public int execute()
	{		
		if(thisUnit!=null)
		{
			if(thisUnit.getState() != 0)
				thisUnit.setState(false);
			thisUnit.clearMissions();
		}
		if(thisUnit.getOwner() != null)
		{
			thisUnit.getOwner().addUnit(thisUnit);
		}
		return 1;
	}
}
